package oopcom;

public class Demo2 {
    public static void main(String[] args) {
        Person person = new Person();
        person.id=001;
        person.name="张三";

        //访问对象属性
        String name = person.name;
        //访问对象方法
        person.sleep();
        person.eat();
        System.out.println(name);
    }
}
